package org.test.app;

import org.test.domain.Client;

import java.sql.SQLException;

public class Main {
    public static void main(String[] args) throws SQLException {
//        EntityManagerFactory emf = Persistence.createEntityManagerFactory("myPersistenceUnit");
//        EntityManager em = emf.createEntityManager(); // Retrieve an application managed entity manager
//        em.getTransaction().begin();
//        em.getTransaction().commit();
//        em.close();
        Client vasya = new Client();
        vasya.setName("Vasya");
        // vasya.setId(new Long(3));
        vasya.setAddress("Grigorenco str. 39a fl.119");
        vasya.setPhoneNumber("565555");
        vasya.setSecondName("sasqqw");
        Factory.getInstance().getClientDAO().create(vasya);
        vasya.setSecondName("MANYA1");
        Factory.getInstance().getClientDAO().update(vasya.getId(), vasya);
    }
}
